#ifndef BRIDGE_H
#define BRIDGE_H

#include "bridge_global.h"

class BRIDGE_EXPORT Bridge: public IBridge
{
private:
	QProcess _process;
	QString _path;
	QString _command;
	QString _selectedDevice;  
	QString _data;
	QString _error;
	QByteArray image;
public:

	Bridge();
	~Bridge();

	//read output data
	void readOutput();

	//get device screenshot
	void readScreenOutput();

	//start adb server
	void startServer();

	//kill adb server
	void killServer();

	//return list of unparsed strings with adb-name and model of device
	QString getDevices();

	//method sets name of the selected device at the moment
	void setSelectedDevice(QString);

	//return path to just made screenshot
	bool getScreenshot(QString);

	//return file system
	QString getFileSystem(QString);

	//method to create new Folder
	bool newFolder(QString, QString);

	//method to remove selected item(folder,file)
	bool Delete(QString, QString);

	//method which provide installing .apk file from selected directory(PC or device)
	bool Install(QString);

	//copy file to device
	bool pushToDevice(QString, QString);

	//copy file from device
	bool pullFromDevice(QString, QString);

	//check if a file exists with the same name
	bool checkName(QString, QString);

	//paste: file or folder path, destination path, bool - copy(true) or cut(false) operation
	// if cut - i will delete file or folder after copying
	bool Paste(QString,QString,bool);


	bool makeBackup(QString);

	bool restoreBackup(QString);

	QString formatToUTF8(QString src);

	QString getDevicesProps(QString device);
};

#endif // BRIDGE_H
